Skip to main content

Full text of "Circuits"

See other formats

TV that Greets You: Adding Sensors 

Make] Projects 

TV that Greets You: Adding 

Written By: Chandler 



Wire stripper/crimper (1) 

• PIR sensor (1) 

22 awg wire (1) 


In this project, we will wire in a sensor and add a program that I made myself, so that our 
TVs greet us when we walk in the room. However, make sure that you have done my 
previous tutorial that teaches how to use an Arduino clone with a TV, and my first one, which 
teaches how to get set up with an Arduino clone. 

) Make Projects Page 1 of 15 

TV that Greets You: Adding Sensors 

Step 1 — Get Started with Arduino Clones 

OWN RISK! I have found that my 
Arduino clone is partially 
dysfunctional (will run TV and LED, 
but not speaker or LCD). Here are 
the parts that you will need. They 
are, from left to right, a 6 or 9 volt 
battery pack, misc. wire, an 
Arduino clone, a breadboard, and a 
7805 voltage regulator. 

Step 2 

1 Place the Arduino clone on the 
breadboard, with one row of pins on 
either side of the breadboard. 

) Make Projects 

Page 2 of 15 

TV that Greets You: Adding Sensors 

Step 3 

• Now, on the "front" side of the 
breadboard, next to the Arduino 
clone, place the 7805 chip with the 
heatsink facing away from you. 

Step 4 

• Next, let's hook up the battery 
pack. Put the positive (red) probe 
into the same row as the far left pin 
of the 7805, and put the negative 
(black) probe into the negative bus 
(the line of pins with the blue line 
over it). Also, run a wire from the 
row with the middle pin of the 7805 
to the negative bus, and run a wire 
from the right pin to the positive 

) Make Projects 

Page 3 of 15 

TV that Greets You: Adding Sensors 

Step 5 

• It's starting to get a tad more 
complex. Run wires from the 
positive bus to the rows with the 
pins labeled "VCC" and "AV," and 
run wires from the negative bus to 
the rows with both of the "GND" 

Step 6 

• Nice job! The LED on the board 
should light up. If it doesn't, make 
sure that you have done all of the 
steps correctly, and that you 
soldered your clone correctly. Now, 
assemble a "parallel programmer," 
which is a device that hooks into a 
Windows or Linux computer (if it 
originally ran Windows) that will 
program this device. If you have a 
AVRISP or other programmer, then 
use that instead. Here is how to 
build a parallel programmer. 

) Make Projects 

Page 4 of 15 

TV that Greets You: Adding Sensors 

Step 7 

• Now, let's build our first project! 
Collect the parts shown (LED, wire, 
and 330 ohm resistor). 

Step 8 

1 See the wire on the right? Connect 
a wire from one negative bus to the 

) Make Projects 

Page 5 of 15 

TV that Greets You: Adding Sensors 

Step 9 

• Now add a resistor from either pin 
13 or pin B5 (depending on the 
model of your Arduino clone), and 
connect it off to a row with nothing 
else on it. 

Step 10 

• Last step before programming: 
place the long (+) probe of the LED 
into the same row as the resistor, 
and the short (-) probe into the new 
negative bus. 

) Make Projects 

Page 6 of 15 

TV that Greets You: Adding Sensors 

Step 11 

• Here's an easy step. Once the 
parallel programmer is finished, 
just hook in into the back of your 
computer, and into the ISP pins on 
the Arduino clone (the 2x3 array of 
pins on the Arduino clone). 

Step 12 

• Now to working with the computer. On Windows, open Program Files, open the Arduino 
folder, and go into /hardware/Ardui no/boards. (For Mac, check Applications, and for Linux, 
check where you installed it). Now, add this to the bottom of the file (retype it, it doesn't 
copy correctly). 

• no Clone with Parallel Programmer 

atmega328pp. upload. protocol=stk500 atmega328pp.upload.maximum_size=30720 
atmega328pp.upload.speed=57600 atmega328pp. upload. using=paral lei 
atmega328pp.bootloader.low_fuses=0xFF atmega328pp.bootloader.high_fuses=0xDA 
atmega328pp.bootloader.extended_fuses=0x05 atmega328pp.bootloader.path=atmega 
atmega328pp. le=ATmegaBOOT_168_atmega328pp. hex 
atmega328pp.bootloader.unlock_bits=0x3F atmega328pp.bootloader.lock_bits=0x0F 

Step 13 

• Now, open the Arduino IDE (get this from ), go into Tools - 
select the option "Arduino Clone with Parallel Programmer." 
) Make Projects 

Page 7 of 15 

TV that Greets You: Adding Sensors 

Step 14 

• Finally, open the Blink program in the IDE (Open button, Basics, "Blink"), and download it 
onto the Arduino clone (Download button). If you are lucky, then you should be able to 
unplug the parallel programmer, and the LED should blink! Note: if you got any errors, 
make sure that the parallel programmer is not touching anything on your board and that 
you followed these steps correctly. 

• Congratulations! Look at the Arduino sample code and the tutorials on this website. For 
future reference: the pin that says "BO" = pin 8, "B1" = pin 9, etc. 

Step 15 — Use an Arduino Clone to Control a TV 

• Welcome back! Gather the 
following parts: 

• Arduino clone from Getting Started 
with Arduino Clones project 

• 2 resistors: 1k and 470 

• Solder-type RCA cable 

• Wire 

) Make Projects 

Page 8 of 15 

TV that Greets You: Adding Sensors 

Step 16 

• Assuming that the wire is speaker 
wire or similar wire with 2 wires 
inside coating, strip the coating off 
of the wire, and strip both of the 
wires inside. 

Step 17 

» Connect the wires to the RCA 
cable. The black (-) wire goes to 
the taller connection, and the red 
(+) wire goes to the shorter 

) Make Projects 

Page 9 of 15 

TV that Greets You: Adding Sensors 

Step 18 

• Before we start wiring, get rid of 
the LED and resistor from the 
previous project. 

Step 19 

• Connect the 470 ohm resistor to 
digital pin 7 (D7), and the 1k ohm 
one to B1 , or pin 9. Make their 
other ends go into the same 
unused row off to the side (sorry 
that the LED assembly is still on 
there in the picture). 

) Make Projects 

Page 10 of 15 

TV that Greets You: Adding Sensors 

Step 20 

• Now, connect the RCA cable. The 
black wire goes to the negative 
bus, and the red wire goes in the 
same row that has the 1 k and 470 
ohm resistors both connected to it. 

Step 21 

• Program the Arduino clone, as in the previous project, with the NTSC demo code that 
comes with the TVout library, available here . (To install the code, just click the Open 
button in the Arduino IDE, and go to "TVout." Click on the code that you want to open. Then 
click the download button.) 

) Make Projects 

Page 11 of 15 

TV that Greets You: Adding Sensors 

Step 22 


470 OHM 

Sync is always OC1A 
VI D Is p7 on any port 

• Now, hook the yellow RCA cable 
up to the yellow input on your TV, 
and turn your TV to channel 2 or 3, 
depending on your TV. An image 
should appear, and your project 
should work! To restart the video, 
press the reset button on your 
Arduino clone. 

Step 23 — TV that Greets You: Adding Sensors 

» Collect these parts: The result of 
the previous project, a RadioShack 
PIR module, and some wire. 

) Make Projects 

Page 12 of 15 

TV that Greets You: Adding Sensors 

Step 24 

• Now, simply place the PIR module 
into the corner of the breadboard, 
with the pins in their own rows. You 
may have to scoot some wires 
over in the positive and negative 

Step 25 

• Now let's wire the PIR module. Run 
a wire from the leftmost pin to 
ground, a wire from the middle pin 
to +5V, and a wire from the right 
pin to pin AO (analog 0). 

) Make Projects 

Page 13 of 15 

TV that Greets You: Adding Sensors 

Step 26 

void setup (H 
myTV, begin (NTSC, 120, 96); 
myTV. seiect_f tint (font6x8); 
iid loop(){ 
if (ana1ogRe3d(Q)>40QK 

■yTV. print In ("I have sensed your presence, 

myTV. del. ay (1000} j 

myTV. c Lea f"_sc reen Q ; 
if (analogRead(0)<40G){ 

myTV. printlnt "Goodbye, human."); 

myTV. delay (1000);; 

• Now let's program this project! Download the following code onto your Arduino clone. 

• #include <font6x8.h> #include <TVout.h> TVout myTV; void setup(){ myTV.begin(NTSC, 
120, 96); myTV.select_font(font6x8); } void loop(){ if(analogRead(0)>400){ myTV.println("l 
have sensed your presence, human."); myTV.delay(IOOO); myTV.clear_screen(); } 
if(analogRead(0)<400){ myTV.println("Goodbye, human."); myTV.delay(IOOO); 
myTV.clear_screen(); } } 

• Sorry that it's crammed into one line. You can piece it together, or use the attached image. 
Note that on the image, the two lines 

• #include <TVout.h> 

• TVout myTV; 

• were cut off. Also, the long line says 

• myTV.printlnfl have sensed your presence, human"); 

• Sorry for the inconvenience. 

) Make Projects 

Page 14 of 15 

TV that Greets You: Adding Sensors 
Step 27 



X **<*v** $to$H v*w- 

Oeodbyl , hum«n , 

Finally! Now it's as easy as plug-and-play. Just plug the yellow RCA cable into your TV 
and watch! 

This document was last generated o 

) Make Projects 

Page 15 of 15